<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  

  <script type="text/javascript" src="queue.js"></script>
  <script type="text/javascript">
    
    var $ = Queue();
    $.queue('f',[f1,f2])
    function f1(next){
      setTimeout(function() {
        alert('f1');
        next()
      },1000)
      
    }
    function f2(ne){
      alert('f2')
      ne()
    }
    $.queue('f',f3)
    function f3() {
      alert('f3')
    }
    $.dequeue('f')

  </script>
</body>
</html>